import { defineConfig } from "vite";
import * as path from "path";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      "@": path.resolve("./src"),
      "@http": path.resolve("./src/request/index.ts"),
    },
    extensions: [".js", ".ts", ".json", ".vue", ".jsx"], // 导入时想要省略的扩展名列表
  },
  server: {
    proxy: {
      "/dev": {
        target: "http://localhost:3000",
        changeOrigin: true,
        rewrite: (path) => path.replace("/dev", ""),
      },
    },
  },
});
